window.__require = function e(t, n, r) {
  function s(o, u) {
    if (!n[o]) {
      if (!t[o]) {
        var b = o.split("/");
        b = b[b.length - 1];
        if (!t[b]) {
          var a = "function" == typeof __require && __require;
          if (!u && a) return a(b, !0);
          if (i) return i(b, !0);
          throw new Error("Cannot find module '" + o + "'");
        }
        o = b;
      }
      var f = n[o] = {
        exports: {}
      };
      t[o][0].call(f.exports, function(e) {
        var n = t[o][1][e];
        return s(n || e);
      }, f, f.exports, e, t, n, r);
    }
    return n[o].exports;
  }
  var i = "function" == typeof __require && __require;
  for (var o = 0; o < r.length; o++) s(r[o]);
  return s;
}({
  BundleScene: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "cab84Au9lxP0aw+2JffydGF", "BundleScene");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
    var NewClass = function(_super) {
      __extends(NewClass, _super);
      function NewClass() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.label = null;
        _this.text = "hello";
        return _this;
      }
      NewClass.prototype.start = function() {};
      __decorate([ property(cc.Label) ], NewClass.prototype, "label", void 0);
      __decorate([ property ], NewClass.prototype, "text", void 0);
      NewClass = __decorate([ ccclass ], NewClass);
      return NewClass;
    }(cc.Component);
    exports.default = NewClass;
    cc._RF.pop();
  }, {} ],
  DialogMgr: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "f51124yTRFMKLjgi3wz2cLb", "DialogMgr");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.default = {
      showTipsWithOkBtn: function(word, okCb, cancelCb, closeCb) {
        var scene = cc.director.getScene();
        if (scene) {
          var w_1 = cc.view.getVisibleSize().width;
          var h_1 = cc.view.getVisibleSize().height;
          cc.resources.load("DialogLayer", cc.Prefab, function(err, prefab) {
            if (!err) {
              var layer = cc.instantiate(prefab);
              layer.x = w_1 / 2;
              layer.y = h_1 / 2;
              scene.addChild(layer);
              var script = layer.getComponent("DialogLayer");
              script && script.showTipsWithOkBtn(word, okCb, cancelCb, closeCb);
            }
          });
        }
      },
      showTipsWithOkCancelBtn: function(word, okCb, cancelCb, closeCb, showCb) {
        var scene = cc.director.getScene();
        if (scene) {
          var w_2 = cc.view.getVisibleSize().width;
          var h_2 = cc.view.getVisibleSize().height;
          cc.resources.load("DialogLayer", cc.Prefab, function(err, prefab) {
            if (!err) {
              var layer = cc.instantiate(prefab);
              layer.x = w_2 / 2;
              layer.y = h_2 / 2;
              scene.addChild(layer);
              var script = layer.getComponent("DialogLayer");
              script && script.showTipsWithOkCancelBtn(word, okCb, cancelCb, closeCb);
              showCb && showCb(layer);
            }
          });
        }
      },
      showTipsWithOkBtnAndNoCloseBtn: function(word, okCb, cancelCb, showCb) {
        var scene = cc.director.getScene();
        if (scene) {
          var w_3 = cc.view.getVisibleSize().width;
          var h_3 = cc.view.getVisibleSize().height;
          cc.resources.load("DialogLayer", function(err, prefab) {
            if (!err) {
              var layer = cc.instantiate(prefab);
              layer.x = w_3 / 2;
              layer.y = h_3 / 2;
              scene.addChild(layer);
              var script = layer.getComponent("DialogLayer");
              if (script) {
                script.showTipsWithOkBtn(word, okCb, cancelCb);
                script.setCloseBtnVisible();
              }
              showCb && showCb(layer);
            }
          });
        }
      }
    };
    cc._RF.pop();
  }, {} ],
  HotUpdateScene: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "4e3896gSG1ARYvY2HWOJOXM", "HotUpdateScene");
    "use strict";
    var __extends = this && this.__extends || function() {
      var extendStatics = function(d, b) {
        extendStatics = Object.setPrototypeOf || {
          __proto__: []
        } instanceof Array && function(d, b) {
          d.__proto__ = b;
        } || function(d, b) {
          for (var p in b) b.hasOwnProperty(p) && (d[p] = b[p]);
        };
        return extendStatics(d, b);
      };
      return function(d, b) {
        extendStatics(d, b);
        function __() {
          this.constructor = d;
        }
        d.prototype = null === b ? Object.create(b) : (__.prototype = b.prototype, new __());
      };
    }();
    var __decorate = this && this.__decorate || function(decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : null === desc ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if ("object" === typeof Reflect && "function" === typeof Reflect.decorate) r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) (d = decorators[i]) && (r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r);
      return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    var HotUpdate_1 = require("./HotUpdate");
    var DialogMgr_1 = require("./DialogMgr");
    var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
    var NewClass = function(_super) {
      __extends(NewClass, _super);
      function NewClass() {
        var _this = null !== _super && _super.apply(this, arguments) || this;
        _this.manifest = null;
        _this.versionLabel = null;
        _this.updateProgress = null;
        _this.tipsLabel = null;
        _this.addNode = null;
        return _this;
      }
      NewClass.prototype.onLoad = function() {
        var _this = this;
        cc.resources.load("DialogLayer");
        this._initView();
        var options = new HotUpdate_1.HotOptions();
        options.OnVersionInfo = function(data) {
          var local = data.local, server = data.server;
          _this.versionLabel.string = "\u672c\u5730\u7248\u672c\u53f7:" + local + ", \u670d\u52a1\u5668\u7248\u672c\u53f7:" + server;
        };
        options.OnUpdateProgress = function(event) {
          var bytes = event.getDownloadedBytes() + "/" + event.getTotalBytes();
          var files = event.getDownloadedFiles() + "/" + event.getTotalFiles();
          var file = event.getPercentByFile().toFixed(2);
          var byte = event.getPercent().toFixed(2);
          var msg = event.getMessage();
          console.log("[update]: \u8fdb\u5ea6=" + file);
          _this.updateProgress.progress = parseFloat(file);
          _this.tipsLabel.string = "\u6b63\u5728\u66f4\u65b0\u4e2d,\u8bf7\u8010\u5fc3\u7b49\u5f85";
          console.log(msg);
        };
        options.OnNeedToUpdate = function(data) {
          DialogMgr_1.default.showTipsWithOkBtn("\u68c0\u6d4b\u5230\u65b0\u7248\u672c,\u70b9\u51fb\u786e\u5b9a\u5f00\u59cb\u66f4\u65b0", function() {
            HotUpdate_1.default.hotUpdate();
          });
        };
        options.OnNoNeedToUpdate = function() {
          _this._enterGame();
        };
        options.OnUpdateFailed = function() {
          _this.tipsLabel.string = "\u66f4\u65b0\u5931\u8d25";
          cc.log("\u70ed\u66f4\u65b0\u5931\u8d25");
          DialogMgr_1.default.showTipsWithOkBtn("\u66f4\u65b0\u5931\u8d25,\u70b9\u51fb\u91cd\u8bd5", function() {
            HotUpdate_1.default.checkUpdate();
          });
        };
        options.OnUpdateSucceed = function() {
          _this.tipsLabel.string = "\u66f4\u65b0\u6210\u529f";
          cc.log("\u66f4\u65b0\u6210\u529f");
          DialogMgr_1.default.showTipsWithOkBtn("\u66f4\u65b0\u6210\u529f,\u70b9\u51fb\u786e\u5b9a\u91cd\u542f\u6e38\u620f", function() {
            cc.audioEngine.stopAll();
            cc.game.restart();
          });
        };
        HotUpdate_1.default.init(this.manifest, options);
      };
      NewClass.prototype._initView = function() {
        this.tipsLabel.string = "";
        this.versionLabel.string = "";
        this.updateProgress.progress = 0;
        this.addNode.destroyAllChildren();
      };
      NewClass.prototype.onBtnClickCheckUpdate = function() {
        if (cc.sys.isNative) {
          if (this.manifest) {
            this.tipsLabel.string = "\u6b63\u5728\u83b7\u53d6\u7248\u672c...";
            HotUpdate_1.default.checkUpdate();
          }
        } else {
          cc.log("web \u5e73\u53f0\u4e0d\u9700\u8981\u70ed\u66f4\u65b0");
          this._enterGame();
        }
      };
      NewClass.prototype._enterGame = function() {
        cc.log("\u8fdb\u5165\u6e38\u620f\u6210\u529f");
        this.updateProgress.node.active = false;
        cc.director.loadScene("GameScene");
      };
      __decorate([ property({
        displayName: "project.manifest",
        type: cc.Asset
      }) ], NewClass.prototype, "manifest", void 0);
      __decorate([ property({
        displayName: "\u7248\u672c\u53f7",
        type: cc.Label
      }) ], NewClass.prototype, "versionLabel", void 0);
      __decorate([ property({
        displayName: "\u70ed\u66f4\u65b0\u8fdb\u5ea6\u6761",
        type: cc.ProgressBar
      }) ], NewClass.prototype, "updateProgress", void 0);
      __decorate([ property({
        displayName: "\u6d88\u606f\u63d0\u793a",
        type: cc.Label
      }) ], NewClass.prototype, "tipsLabel", void 0);
      __decorate([ property({
        displayName: "\u6dfb\u52a0\u8282\u70b9",
        type: cc.Node
      }) ], NewClass.prototype, "addNode", void 0);
      NewClass = __decorate([ ccclass ], NewClass);
      return NewClass;
    }(cc.Component);
    exports.default = NewClass;
    cc._RF.pop();
  }, {
    "./DialogMgr": "DialogMgr",
    "./HotUpdate": "HotUpdate"
  } ],
  HotUpdate: [ function(require, module, exports) {
    "use strict";
    cc._RF.push(module, "a6892F726RKWJp4vK12agti", "HotUpdate");
    "use strict";
    Object.defineProperty(exports, "__esModule", {
      value: true
    });
    exports.HotOptions = void 0;
    var HotOptions = function() {
      function HotOptions() {}
      HotOptions.prototype.check = function() {
        for (var key in this) if ("check" !== key && !this[key]) {
          cc.log("\u53c2\u6570HotOptions." + key + "\u672a\u8bbe\u7f6e\uff01");
          return false;
        }
        return true;
      };
      return HotOptions;
    }();
    exports.HotOptions = HotOptions;
    var Hot = function() {
      function Hot() {
        this._assetsMgr = null;
        this._options = null;
        this._state = Hot.State.None;
      }
      Hot.prototype.checkUpdate = function() {
        if (!this._assetsMgr) {
          cc.log("\u8bf7\u5148\u521d\u59cb\u5316");
          return;
        }
        if (this._assetsMgr.getState() === jsb.AssetsManager.State.UNINITED) {
          cc.error("\u672a\u521d\u59cb\u5316");
          return;
        }
        if (!this._assetsMgr.getLocalManifest().isLoaded()) {
          console.log("\u52a0\u8f7d\u672c\u5730 manifest \u5931\u8d25 ...");
          return;
        }
        this._assetsMgr.setEventCallback(this._hotUpdateCallBack.bind(this));
        this._state = Hot.State.Check;
        this._assetsMgr.checkUpdate();
      };
      Hot.prototype.hotUpdate = function() {
        if (!this._assetsMgr) {
          cc.log("\u8bf7\u5148\u521d\u59cb\u5316");
          return;
        }
        this._assetsMgr.setEventCallback(this._hotUpdateCallBack.bind(this));
        this._state = Hot.State.Update;
        this._assetsMgr.update();
      };
      Hot.prototype._hotUpdateCallBack = function(event) {
        var code = event.getEventCode();
        cc.log("hotUpdate Code: " + code);
        switch (code) {
         case jsb.EventAssetsManager.ALREADY_UP_TO_DATE:
          cc.log("\u5df2\u7ecf\u548c\u8fdc\u7a0b\u7248\u672c\u4e00\u81f4\uff0c\u65e0\u987b\u66f4\u65b0");
          this._options.OnNoNeedToUpdate && this._options.OnNoNeedToUpdate(code);
          break;

         case jsb.EventAssetsManager.NEW_VERSION_FOUND:
          cc.log("\u53d1\u73b0\u65b0\u7248\u672c,\u8bf7\u66f4\u65b0");
          this._options.OnNeedToUpdate && this._options.OnNeedToUpdate(code);
          break;

         case jsb.EventAssetsManager.UPDATE_PROGRESSION:
          cc.log("\u66f4\u65b0\u4e2d...");
          this._state === Hot.State.Update && this._options.OnUpdateProgress && this._options.OnUpdateProgress(event);
          break;

         case jsb.EventAssetsManager.UPDATE_FINISHED:
          cc.log("\u66f4\u65b0\u6210\u529f");
          this._onUpdateFinished();
          break;

         case jsb.EventAssetsManager.ASSET_UPDATED:
          break;

         default:
          this._onUpdateFailed(code);
        }
      };
      Hot.prototype._onUpdateFailed = function(code) {
        this._assetsMgr.setEventCallback(null);
        this._options.OnUpdateFailed && this._options.OnUpdateFailed(code);
      };
      Hot.prototype._onUpdateFinished = function() {
        this._assetsMgr.setEventCallback(null);
        var searchPaths = jsb.fileUtils.getSearchPaths();
        var newPaths = this._assetsMgr.getLocalManifest().getSearchPaths();
        cc.log("[HotUpdate] \u641c\u7d22\u8def\u5f84: " + JSON.stringify(newPaths));
        Array.prototype.unshift(searchPaths, newPaths);
        cc.sys.localStorage.setItem("HotUpdateSearchPaths", JSON.stringify(searchPaths));
        jsb.fileUtils.setSearchPaths(searchPaths);
        this._options.OnUpdateSucceed && this._options.OnUpdateSucceed();
      };
      Hot.prototype.showSearchPath = function() {
        cc.log("========================\u641c\u7d22\u8def\u5f84========================");
        var searchPaths = jsb.fileUtils.getSearchPaths();
        for (var i = 0; i < searchPaths.length; i++) cc.log("[" + i + "]: " + searchPaths[i]);
        cc.log("======================================================");
      };
      Hot.prototype.init = function(manifest, opt) {
        var _this = this;
        if (!cc.sys.isNative) return;
        if (!opt.check()) return;
        this._options = opt;
        if (this._assetsMgr) return;
        this.showSearchPath();
        var url = manifest.nativeUrl;
        cc.loader.md5Pipe && (url = cc.loader.md5Pipe.transformURL(url));
        var storagePath = (jsb.fileUtils ? jsb.fileUtils.getWritablePath() : "/") + "remote-asset";
        this._assetsMgr = new jsb.AssetsManager(url, storagePath, function(versionA, versionB) {
          cc.log("\u5ba2\u6237\u7aef\u7248\u672c: " + versionA + ", \u5f53\u524d\u6700\u65b0\u7248\u672c: " + versionB);
          _this._options.OnVersionInfo({
            local: versionA,
            server: versionB
          });
          var vA = versionA.split(".");
          var vB = versionB.split(".");
          for (var i = 0; i < vA.length; ++i) {
            var a = parseInt(vA[i]);
            var b = parseInt(vB[i] || "0");
            if (a !== b) return a - b;
          }
          return vB.length > vA.length ? -1 : 0;
        });
        this._assetsMgr.setVerifyCallback(function(assetsFullPath, asset) {
          var compressed = asset.compressed, md5 = asset.md5, path = asset.path, size = asset.size;
          return compressed, true;
        });
        cc.sys.os === cc.sys.OS_ANDROID;
        var localManifest = this._assetsMgr.getLocalManifest();
        cc.log("[HotUpdate] \u70ed\u66f4\u65b0\u8d44\u6e90\u5b58\u653e\u8def\u5f84: " + storagePath);
        cc.log("[HotUpdate] \u672c\u5730manifest\u8def\u5f84: " + url);
        cc.log("[HotUpdate] local packageUrl: " + localManifest.getPackageUrl());
        cc.log("[HotUpdate] project.manifest remote url: " + localManifest.getManifestFileUrl());
        cc.log("[HotUpdate] version.manifest remote url: " + localManifest.getVersionFileUrl());
      };
      Hot.State = {
        None: 0,
        Check: 1,
        Update: 2
      };
      return Hot;
    }();
    var hotInstance = new Hot();
    exports.default = hotInstance;
    cc._RF.pop();
  }, {} ]
}, {}, [ "BundleScene", "DialogMgr", "HotUpdate", "HotUpdateScene" ]);